

if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	
	SWEP.HoldType			= "ar2"
	
end

if ( CLIENT ) then

	SWEP.PrintName			= "LEONE 12 GAUGE SUPER"			
	SWEP.Author			= "Counter-Strike"
	SWEP.Slot			= 3
	SWEP.SlotPos			= 2
	SWEP.IconLetter			= "k"
	SWEP.WeaponSelectIconLetter     = "K"
	SWEP.DrawAmmo			= true
        SWEP.DrawWeaponInfoBox	        = true					// Should draw the weapon info box
        SWEP.BounceWeaponIcon           = false					// Should the weapon icon bounce?
        SWEP.SwayScale			= 1.0					// The scale of the viewmodel sway
        SWEP.BobScale			= 1.0					// The scale of the viewmodel bob
        SWEP.WepSelectIcon		= surface.GetTextureID( "weapons/swep" )
	SWEP.ViewModelFOV		= 75
	SWEP.ViewModelFlip		= true
	SWEP.CSMuzzleFlashes	        = true
	
	killicon.AddFont( "weapon_m3_ryno", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
	
end


SWEP.Base				= "ryno_base_css"
SWEP.Category			= "Counter-Strike (RynO-SauruS) - Sniper Rifles and Shotguns"

SWEP.Spawnable			= false
SWEP.AdminSpawnable		= true

SWEP.ViewModel			= "models/weapons/v_shot_m3super90.mdl"
SWEP.WorldModel			= "models/weapons/w_shot_m3super90.mdl"

SWEP.Weight				= 5
SWEP.AutoSwitchTo		= false
SWEP.AutoSwitchFrom		= false

SWEP.ShakeWeaponSelectIcon      = false

//SWEP.TracerType                 = "AR2Tracer"

//Some Possible Tracer Values:
// Tracer
// AR2Tracer
// HelicopterTracer
// AirboatGunTracer
// AirboatGunHeavyTracer

SWEP.InfiniteAmmo                       = false
SWEP.UseScope                           = false
SWEP.WeaponDeploySpeed                  = 1

SWEP.ZoomedPrimaryAutomatic             = false
SWEP.ZoomedPrimaryDelay                 = 0.95
SWEP.ZoomedPrimaryCone                  = 0.03
SWEP.ZoomedPrimaryDamage                = 9
SWEP.ZoomedPrimaryRecoil                = 5
SWEP.ZoomedTracerFreq                   = 0
SWEP.ZoomedDrawCrosshair		= false

SWEP.UnzoomedPrimaryAutomatic           = false
SWEP.UnzoomedPrimaryDelay               = 0.95
SWEP.UnzoomedPrimaryCone                = 0.03
SWEP.UnzoomedPrimaryDamage              = 9
SWEP.UnzoomedPrimaryRecoil              = 5
SWEP.UnzoomedTracerFreq                 = 1
SWEP.UnzoomedDrawCrosshair		= false

SWEP.Primary.BulletForce                = "5"
SWEP.Primary.WeaponDrawSound            = ""
SWEP.Primary.CustomReloadSound          = ""
SWEP.Primary.Sound			= "Weapon_M3.Single"
SWEP.Primary.NumShots		= 9
SWEP.Primary.ClipSize		= 8
SWEP.Primary.DefaultClip	= 16
SWEP.Primary.Ammo			= "buckshot"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo			= "none"

SWEP.IronSightsPos 		= Vector( 5.7, -3, 3 )

//The complex reloading script here seems to break some functions of my weapon base.
//So, to make this weapon functon properly on my weapon base, I must add some default settings here.

SWEP.Primary.Automatic                  = false
SWEP.Primary.Delay			= 0.95
SWEP.Primary.Cone			= 0.03
SWEP.Primary.Damage			= 22
SWEP.Primary.Recoil			= 0.2
SWEP.TracerFreq                         = 1


/*---------------------------------------------------------
	Reload does nothing
---------------------------------------------------------*/
function SWEP:Reload()
	
	//if ( CLIENT ) then return end
	
	self:SetIronsights( false )
	
	// Already reloading
	if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then return end
	
	// Start reloading if we can
	if ( self.Weapon:Clip1() < self.Primary.ClipSize && self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
		
		self.Weapon:SetNetworkedBool( "reloading", true )
		self.Weapon:SetVar( "reloadtimer", CurTime() + 0.3 )
		self.Weapon:SendWeaponAnim( ACT_VM_RELOAD )
		
	end

end

/*---------------------------------------------------------
   Think does nothing
---------------------------------------------------------*/
function SWEP:Think()


	if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then
	
		if ( self.Weapon:GetVar( "reloadtimer", 0 ) < CurTime() ) then
			
			// Finsished reload -
			if ( self.Weapon:Clip1() >= self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 ) then
				self.Weapon:SetNetworkedBool( "reloading", false )
				return
			end
			
			// Next cycle
			self.Weapon:SetVar( "reloadtimer", CurTime() + 0.3 )
			self.Weapon:SendWeaponAnim( ACT_VM_RELOAD )
			
			// Add ammo
			self.Owner:RemoveAmmo( 1, self.Primary.Ammo, false )
			self.Weapon:SetClip1(  self.Weapon:Clip1() + 1 )
			
			// Finish filling, final pump
			if ( self.Weapon:Clip1() >= self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 ) then
				self.Weapon:SendWeaponAnim( ACT_SHOTGUN_RELOAD_FINISH )
			else
			
			end
			
		end
	
	end

end